﻿using MediatR;
using RBAC.LuFang.API.Application.Command.RoleCommand;
using RBAC.LuFang.Domain.DTO;
using RBAC.LuFang.Domin.Services;

namespace RBAC.LuFang.API.Application.CommandHandlers.RoleHandler
{
    //根据部门ID查询员工名称
    public class GettemployeeCommanHandler:IRequestHandler<GettemployeeCommand, List<GetemployeeDTO>>
    {
        private readonly IRoleService _roleService;

        public GettemployeeCommanHandler(IRoleService roleService)
        {
            _roleService = roleService;
        }

        public async Task<List<GetemployeeDTO>> Handle(GettemployeeCommand request, CancellationToken cancellationToken)
        {
            return await _roleService.Getemployee(request.sectionId);
        }
    }
}
